 // pages/personalstore/personalstore.js
 var app = getApp();
 var com = require('../../common.js');
 Page({
   data: {
     statusd: 1,
     priceHiden: true,
     storename: ''
   },
   onLoad: function(options) {
     var _this = this
     setTimeout(() => {
       _this.setData({
         statusd: 0
       })
     }, 1500)
     if (wx.getStorageSync('token')) {} else {
       wx.reLaunch({
         url: '/pages/login/login',
       })
       return false;
     }
     if (!wx.getStorageSync('token')) {
       return false;
     }
     //获取金额
     com.link(app.link.kinks, {}, function(rep) {
       console.log(rep)
       _this.setData({
         price: rep.data.response.balance
       })
     }, "GET")
   },
   hidPrice(e) {
     var _this = this,
       id = e.currentTarget.id
     _this.setData({
       priceHiden: id == 1 ? true : false
     })
   },
   goApprove: function() {
     wx.navigateTo({
       url: '/pages/approve/approve',
     })
   },
   onReady: function() {},
   onShow: function() {

     var _this = this
     if (typeof this.getTabBar === 'function' &&
       this.getTabBar()) {
       this.getTabBar().setData({
         selected: 3
       })
     }
     let url = app.link.appraisal,
       data = {}
     if (!wx.getStorageSync('token')) {
       return false;
     }
     com.link(url, data, function(rep) {
       console.log(rep)
       _this.setData({
         state: rep.data.response.response,
       })
     }, 'GET')
   },
   onBanJump(e) {
     var id = e.currentTarget.id
     if (id == 1) {
       wx.navigateTo({
        //  url: "/pages/bankPage/bankPage"
         url:'/pages/newPageBankIndex/newPageBankIndex'
       })
     } else {
       wx.navigateTo({
         url: "/pages/shopGrop/shopGrop"
       })
     }

     return false;
     var _this = this,
       state = _this.data.state
     if (state.account == "succeeded") {
       wx.navigateTo({
         url: '/pages/bankUser/bankUser',
       })
       return false
     }
     if (state.account == "init" || state.account == "failed") {
       wx.navigateTo({
         url: "/pages/bankPage/bankPage"
       })
       return false
     }
     var msg = ''
     if (state.account == "pending") {
       msg = '开户审核中'
     }
     if (state.account == "frozen") {
       msg = '账户冻结'
     }
     if (state.account == "submitted") {
       msg = '账户待激活'
     }
     wx.showModal({
       title: '温馨提示',
       content: msg,
     })
   },
   onHide: function() {},
   onUnload: function() {},
   onPullDownRefresh: function() {},
   onReachBottom: function() {},
   //获取开通情况
   onShopStatus(e) {
     var _this = this,
     id = e.currentTarget.id
     wx.navigateTo({
       url: id == 1 ? '/pages/onCooperation/onCooperation' :'/pages/onDataPlan/onDataPlan',
     })
     return false
     com.link(app.link.onShopStatus + wx.getStorageSync('store') + '.st', {}, function(res) {
       console.log(res)
       if (res.data.meituan.join == "empty") {
         wx.navigateTo({
           url: '/pages/PageIndex/PageIndex',
         })
       } else {
         wx.navigateTo({
           url: '/pages/onCooperation/onCooperation',
         })
       }
     }, "GET")
   },
   exrt: function() {
     wx.showModal({
       title: '温馨提示',
       content: '你是否退出此账号',
       success: res => {
         if (res.confirm) {
           wx.clearStorageSync('token');
           wx.reLaunch({
             url: '../login/login',
           })
         }
       }
     })

   }
 })